﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Coding4Fun.UsbCannon.Phone" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" 
    x:Class="Coding4Fun.UsbCannon.Phone.MainPage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    x:Name="page"
    Loaded="PhoneApplicationPage_Loaded" 
    OrientationChanged="PhoneApplicationPage_OrientationChanged"
    Padding="10,0" d:DesignHeight="800" d:DesignWidth="480">
	<phone:PhoneApplicationPage.Resources>
		<Storyboard x:Name="UXSB_Alarm">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="UXAlarmCover" RepeatBehavior="5x">
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</phone:PhoneApplicationPage.Resources>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>
    
<!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" Width="480" Height="800">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="VisualStateGroup">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0"/>
    				<VisualTransition From="Start" GeneratedDuration="0:0:0.2" To="Normal">
    					<Storyboard>
    						<DoubleAnimation BeginTime="0:0:1" Duration="0:0:0.2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="UXDarts"/>
    						<DoubleAnimation BeginTime="0:0:1" Duration="0:0:0.2" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="UXDarts"/>
    						<PointAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="UXChromeText_USB" BeginTime="0:0:0.2" To="0,0"/>
    						<PointAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="UXChromeText_USB" BeginTime="0:0:0.2"/>
    						<PointAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="UXChromeText_Missile" BeginTime="0:0:0.4"/>
    						<PointAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="UXChromeText_Launcher" BeginTime="0:0:0.6"/>
    						<PointAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="UXChromeText_Missile" BeginTime="0:0:0.4"/>
    						<PointAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="UXChromeText_Launcher" BeginTime="0:0:0.6"/>
    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXChromeGlow1">
    							<DiscreteObjectKeyFrame KeyTime="0:0:0.2">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    							<DiscreteObjectKeyFrame KeyTime="0:0:0.6">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Collapsed</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    						<DoubleAnimation Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="UXChromeGlow1" BeginTime="0:0:0.2"/>
    						<DoubleAnimation BeginTime="0:0:0.4" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="UXChromeGlow2"/>
    						<DoubleAnimation BeginTime="0:0:0.6" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="UXChromeGlow3"/>
    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXChromeGlow2">
    							<DiscreteObjectKeyFrame KeyTime="0:0:0.4">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    							<DiscreteObjectKeyFrame KeyTime="0:0:0.8">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Collapsed</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXChromeGlow3">
    							<DiscreteObjectKeyFrame KeyTime="0:0:0.6">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    							<DiscreteObjectKeyFrame KeyTime="0:0:1">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Collapsed</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXCoding4Fun_Logo">
    							<DiscreteObjectKeyFrame KeyTime="0">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    						<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXDarts">
    							<DiscreteObjectKeyFrame KeyTime="0:0:1">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    					</Storyboard>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="Normal"/>
    			<VisualState x:Name="Start">
    				<Storyboard>
    					<DoubleAnimation Duration="0" To="0.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="UXDarts"/>
    					<DoubleAnimation Duration="0" To="0.1" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="UXDarts"/>
    					<DoubleAnimation Duration="0" To="4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="UXCoding4Fun_Logo"/>
    					<DoubleAnimation Duration="0" To="4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="UXCoding4Fun_Logo"/>
    					<DoubleAnimation Duration="0" To="-20" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="UXCoding4Fun_Logo"/>
    					<PointAnimation Duration="0" To="-1,0" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="UXChromeText_USB"/>
    					<PointAnimation Duration="0" To="1,0" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="UXChromeText_USB"/>
    					<PointAnimation Duration="0" To="-1,0" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="UXChromeText_Missile"/>
    					<PointAnimation Duration="0" To="-1,0" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.StartPoint)" Storyboard.TargetName="UXChromeText_Launcher"/>
    					<PointAnimation Duration="0" To="1,0" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="UXChromeText_Missile"/>
    					<PointAnimation Duration="0" To="1,0" Storyboard.TargetProperty="(UIElement.OpacityMask).(LinearGradientBrush.EndPoint)" Storyboard.TargetName="UXChromeText_Launcher"/>
    					<DoubleAnimation Duration="0" To="-92" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="UXChromeGlow1"/>
    					<DoubleAnimation Duration="0" To="-92" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="UXChromeGlow2"/>
    					<DoubleAnimation Duration="0" To="-92" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="UXChromeGlow3"/>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXCoding4Fun_Logo">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Collapsed</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXDarts">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<Visibility>Collapsed</Visibility>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    		<VisualStateGroup x:Name="VisualStateGroup_Lights">
    			<VisualState x:Name="Off"/>
    			<VisualState x:Name="Left">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ToggleButton.IsChecked)" Storyboard.TargetName="UXArrowLeft">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="Right">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ToggleButton.IsChecked)" Storyboard.TargetName="UXArrowRight">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="Up">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ToggleButton.IsChecked)" Storyboard.TargetName="UXArrowUp">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="Down">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ToggleButton.IsChecked)" Storyboard.TargetName="UXArrowDown">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<System:Boolean>True</System:Boolean>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Image x:Name="UXBackground" Source="Resources/Background.jpg" Stretch="Fill"/>
        <Grid x:Name="UXControlPad" VerticalAlignment="Bottom" Height="500" Margin="0,0,0,25">
        	<Grid.RowDefinitions>
        		<RowDefinition/>
        		<RowDefinition Height="Auto"/>
        		<RowDefinition/>
        	</Grid.RowDefinitions>
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition/>
        		<ColumnDefinition Width="Auto"/>
        		<ColumnDefinition/>
        	</Grid.ColumnDefinitions>
        	<CheckBox x:Name="UXArrowLeft" Content="CheckBox" Style="{StaticResource CheckBoxStyle_LeftArrow}" Margin="0,8,36,0" Grid.Row="1"/>
        	<CheckBox x:Name="UXArrowRight" Content="CheckBox" Style="{StaticResource CheckBoxStyle_RightArrow}" Margin="36,8,0,0" Grid.Row="1" Grid.Column="2"/>
        	<CheckBox x:Name="UXArrowUp" Content="CheckBox" Style="{StaticResource CheckBoxStyle_UpArrow}" Margin="0,0,2,30" Grid.Column="1"/>
        	<CheckBox x:Name="UXArrowDown" Content="CheckBox" Style="{StaticResource CheckBoxStyle_DownArrow}" Margin="0,41,2,0" Grid.Column="1" Grid.Row="2"/>
        	<Button x:Name="UXFireButton" Content="Fire" Click="Button_Click" Style="{StaticResource ButtonStyle_Fire}" Grid.Row="1" Grid.Column="1" />
        	<Button x:Name="UXSettingsButton" Content="Settings" VerticalAlignment="Bottom" Click="UXSettingsButton_Click" Grid.Row="2" HorizontalAlignment="Left" Style="{StaticResource ButtonStyle_Settings}" Margin="45,0,0,25"/>

        </Grid>
        <Grid x:Name="UXApplicationTitle" Height="160" Margin="30,110,30,0" VerticalAlignment="Top">
        	<StackPanel x:Name="UXChromeText" >
        		<Image x:Name="UXChromeText_USB" HorizontalAlignment="Left" Height="59" Source="Resources/ChromeText_USB.png" Stretch="Fill" Width="202" Margin="0,6,0,-14">
        			<Image.OpacityMask>
        				<LinearGradientBrush EndPoint="2,0" StartPoint="0,0">
        					<GradientStop Color="Black" Offset="0.5"/>
        					<GradientStop Offset="0.5"/>
        				</LinearGradientBrush>
        			</Image.OpacityMask>
        		</Image>
        		<Image x:Name="UXChromeText_Missile" Height="66" Margin="0,6,0,-18" Source="Resources/ChromeText_Missile.png" Stretch="Fill" Width="420" HorizontalAlignment="Left">    			<Image.OpacityMask>
        				<LinearGradientBrush EndPoint="2,0" StartPoint="0,0">
        					<GradientStop Color="Black" Offset="0.5"/>
        					<GradientStop Offset="0.5"/>
        				</LinearGradientBrush>
        			</Image.OpacityMask>
        		</Image>
        		<Image x:Name="UXChromeText_Launcher" Height="54" Margin="0,6,0,-18" Source="Resources/ChromeText_Launcher.png" Stretch="Fill" Width="420" HorizontalAlignment="Left">    			<Image.OpacityMask>
        				<LinearGradientBrush EndPoint="2,0" StartPoint="0,0">
        					<GradientStop Color="Black" Offset="0.5"/>
        					<GradientStop Offset="0.5"/>
        				</LinearGradientBrush>
        			</Image.OpacityMask>
        		</Image>
        	</StackPanel>
        	<local:ChromeGlow x:Name="UXChromeGlow1" HorizontalAlignment="Left" Height="40" Margin="0,10,0,0" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
        		<local:ChromeGlow.RenderTransform>
        			<CompositeTransform TranslateX="95"/>
        		</local:ChromeGlow.RenderTransform>
        	</local:ChromeGlow>
        	<local:ChromeGlow x:Name="UXChromeGlow2" HorizontalAlignment="Left" Height="48" Margin="0,61,0,0" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
        		<local:ChromeGlow.RenderTransform>
        			<CompositeTransform TranslateX="315"/>
        		</local:ChromeGlow.RenderTransform>
        	</local:ChromeGlow>
        	<local:ChromeGlow x:Name="UXChromeGlow3" HorizontalAlignment="Left" Height="36" Margin="0,115,0,0" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
        		<local:ChromeGlow.RenderTransform>
        			<CompositeTransform TranslateX="315"/>
        		</local:ChromeGlow.RenderTransform>
        	</local:ChromeGlow>
        </Grid>
    	<Image x:Name="UXCoding4Fun_Logo" HorizontalAlignment="Left" Height="56" Source="Resources/Coding4Fun_Logo.png" Stretch="Fill" VerticalAlignment="Top" Width="230" Margin="15,47,0,0" RenderTransformOrigin="0.5,0.5">
    		<Image.RenderTransform>
    			<CompositeTransform/>
    		</Image.RenderTransform>
    	</Image>
    	<Image x:Name="UXDarts" Height="148" Source="Resources/Darts.png" Stretch="Fill" VerticalAlignment="Top" Width="266" HorizontalAlignment="Right" Margin="0,8,8,0" RenderTransformOrigin="-1,1.3">
    		<Image.RenderTransform>
    			<CompositeTransform/>
    		</Image.RenderTransform>
    	</Image>
    	<Rectangle x:Name="UXAlarmCover" Fill="Red" Opacity="0" IsHitTestVisible="False"/>

        <!--<StackPanel x:Name="ContentGrid" Grid.Row="1" Background="Black" Height="100" VerticalAlignment="Top">
            <TextBlock>Pitch</TextBlock>
            <TextBlock Text="{Binding Path=PitchAngle}" />
            <TextBlock>Roll</TextBlock>
            <TextBlock Text="{Binding Path=RollAngle}" />
            
        </StackPanel>-->
    </Grid>


</phone:PhoneApplicationPage>
